package com.cd.music.dto;

import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: Ｆ码数据
 * @date 2018年03月05日  上午11:31
 * @address: 四川成都
 */
public class FCodeDto extends BaseDto {
    /**
     * 数据id
     */
    private String id;
    /**
     * Ｆ码的值
     */
    private String value;
    /**
     * Ｆ码的状态(是否使用 true：已使用，false：未使用)
     */
    private boolean isUse;
    /**
     * 创建时间
     */
    private Date createTime;

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public boolean getIsUse() {
        return isUse;
    }

    public void setIsUse(boolean use) {
        isUse = use;
    }

    public Date getCreateTime() {
        return createTime != null ? (Date) createTime.clone() : null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? (Date) createTime.clone() : null;
    }

    public FCodeDto() {

    }

    private FCodeDto(Builder builder) {
        setToken(builder.token);
        setPageIndex(builder.pageIndex);
        setPageSize(builder.pageSize);
        setTotal(builder.total);
        setId(builder.id);
        setValue(builder.value);
        setIsUse(builder.isUse);
        setCreateTime(builder.createTime);
        setTotal(builder.total);
    }

    public static Builder builder() {
        return new Builder();
    }


    public static final class Builder {
        private String id;
        private String value;
        private boolean isUse;
        private Date createTime;
        private int total;
        private String token;
        private Integer pageIndex;
        private Integer pageSize;

        private Builder() {
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder value(String value) {
            this.value = value;
            return this;
        }

        public Builder isUse(boolean isUse) {
            this.isUse = isUse;
            return this;
        }

        public Builder createTime(Date createTime) {
            this.createTime = createTime != null ? (Date) createTime.clone() : null;
            return this;
        }

        public Builder total(int total) {
            this.total = total;
            return this;
        }

        public FCodeDto build() {
            return new FCodeDto(this);
        }

        public Builder token(String token) {
            this.token = token;
            return this;
        }

        public Builder pageIndex(Integer pageIndex) {
            this.pageIndex = pageIndex;
            return this;
        }

        public Builder pageSize(Integer pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public Builder total(Integer total) {
            this.total = total;
            return this;
        }
    }
}
